home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / em-xmkit.zip / EMM14_A.ASM < prev    next >
Assembly Source File  |  1989-11-29  |  6KB  |  106 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM14_A.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   get_all_handles_pages                                   ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function returns an array of structures that       ;
  7. ;                     contain open EMM handles and the number of pages        ;
  8. ;                     allocated to each one.                                  ;
  9. ;                                                                             ;
  10. ;           PASSED:   &hp_count:                                              ;
  11. ;                        is a far pointer to the number of open EMM handles.  ;
  12. ;                                                                             ;
  13. ;                     hp:                                                     ;
  14. ;                        is a far pointer to an array of structures that      ;
  15. ;                        will contain all open EMM handles and the number of  ;
  16. ;                        pages allocated to each.                             ;
  17. ;                                                                             ;
  18. ;         RETURNED:   status:                                                 ;
  19. ;                        is the status EMM returns from the call.  All other  ;
  20. ;                        returned results are valid only if the status        ;
  21. ;                        returned is zero.  Otherwise they are undefined.     ;
  22. ;                                                                             ;
  23. ;                     hp_count:                                               ;
  24. ;                        is the number of open EMM handles (including the     ;
  25. ;                        operating system handle [0]).  hp_count cannot be    ;
  26. ;                        zero because the operating system handle is always   ;
  27. ;                        active and cannot be deallocated.  hp_count will     ;
  28. ;                        not exceed 255.                                      ;
  29. ;                                                                             ;
  30. ;                     hp:                                                     ;
  31. ;                        is an array of structures containing all open EMM    ;
  32. ;                        handles and the number of pages allocated to each.   ;
  33. ;                        The structure members are described here:            ;
  34. ;                                                                             ;
  35. ;                        hp.handle:                                           ;
  36. ;                           is the open EMM handle.  The values of the        ;
  37. ;                           handles this function returns will be in the      ;
  38. ;                           range of 0 to 255 decimal.                        ;
  39. ;                                                                             ;
  40. ;                        hp.pages_allocated:                                  ;
  41. ;                           is the number of pages allocated to the open      ;
  42. ;                           EMM handle.                                       ;
  43. ;                                                                             ;
  44. ; C USE CONVENTION:   unsigned int         status;                            ;
  45. ;                     unsigned int         hp_count;                          ;
  46. ;                     HANDLES_PAGES_STRUCT hp[MAX_HANDLES];                   ;
  47. ;                                                                             ;
  48. ;                     status = get_all_handles_pages (&hp_count,              ;
  49. ;                                                     hp);                    ;
  50. ;-----------------------------------------------------------------------------;
  51. .XLIST
  52. PAGE    60,132
  53.  
  54. IFDEF SMALL
  55.    .MODEL SMALL, C
  56. ENDIF
  57. IFDEF MEDIUM
  58.    .MODEL MEDIUM, C
  59. ENDIF
  60. IFDEF LARGE
  61.    .MODEL LARGE, C
  62. ENDIF
  63. IFDEF COMPACT
  64.    .MODEL COMPACT, C
  65. ENDIF
  66. IFDEF HUGE
  67.    .MODEL HUGE, C
  68. ENDIF
  69.  
  70. INCLUDE emmlib.equ
  71. INCLUDE emmlib.str
  72. INCLUDE emmlib.mac
  73. .LIST
  74. .CODE
  75.  
  76. get_all_handles_pages    PROC                                                  \
  77.             USES DI,                                              \
  78.                         ptr_handles_pages_count:FAR PTR WORD,                     \
  79.             ptr_handles_pages:FAR PTR BYTE                            
  80.  
  81.     ;---------------------------------------------------------------------;
  82.     ;   do;                                                               ;
  83.     ;   .   get a structure of all active handles and the pages           ;
  84.     ;   .   allocated to each handle;                                     ;
  85.     ;---------------------------------------------------------------------;
  86.     MOVE        AH, get_all_handle_pages_fcn
  87.     MOVE        ES:DI, ptr_handles_pages
  88.     INT         EMM_int
  89.  
  90.     ;---------------------------------------------------------------------;
  91.     ;   .   pass the number of structure entries back to the caller;      ;
  92.     ;---------------------------------------------------------------------;
  93.     MOVE        DX, BX
  94.     MOVE        ES:BX, ptr_handles_pages_count
  95.     MOVE        ES:[BX], DX
  96.  
  97.     ;---------------------------------------------------------------------;
  98.     ;   .   return (EMM status);                                          ;
  99.     ;   end;                                                              ;
  100.     ;---------------------------------------------------------------------;
  101.     RET_EMM_STAT    AH
  102.  
  103. get_all_handles_pages    ENDP
  104.  
  105. END
  106.